#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//

int n;
void solve()
{
	cin>>n;
	vector<int> ans;
	
	if(!(n%2)) cout<<-1<<'\n';
	else
	{
		
		while(n!=1)
		{
			int t1=n+1;
			int t2=n-1;
			if(t1/2%2==0)
			{
				ans.push_back(2);
				n=t2/2;
			}
			else
			{
				ans.push_back(1);
				n=t1/2;
			}
		}

		cout<<ans.size()<<'\n';
		for(int i=ans.size()-1;i>=0;i--) cout<<ans[i]<<" ";
		cout<<'\n';		
		
	}

	
}

int main()
{
	close();
	int T; cin>>T;
	while (T--) solve();
	return 0;
}

